Optimal. Leaf size=151 \[ -\frac {3 i d x}{16 a^2 f}-\frac {d x^2}{8 a^2}+\frac {x (c+d x)}{4 a^2}+\frac {d}{16 f^2 (a+i a \tan (e+f x))^2}+\frac {i (c+d x)}{4 f (a+i a \tan (e+f x))^2}+\frac {3 d}{16 f^2 \left (a^2+i a^2 \tan (e+f x)\right )}+\frac {i (c+d x)}{4 f \left (a^2+i a^2 \tan (e+f x)\right )} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.10, antiderivative size = 151, normalized size of antiderivative = 1.00, number of steps
used = 7, number of rules used = 3, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {3560, 8, 3811}
\begin {gather*} \frac {i (c+d x)}{4 f \left (a^2+i a^2 \tan (e+f x)\right )}+\frac {x (c+d x)}{4 a^2}+\frac {3 d}{16 f^2 \left (a^2+i a^2 \tan (e+f x)\right )}-\frac {3 i d x}{16 a^2 f}-\frac {d x^2}{8 a^2}+\frac {i (c+d x)}{4 f (a+i a \tan (e+f x))^2}+\frac {d}{16 f^2 (a+i a \tan (e+f x))^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 3560
Rule 3811
Rubi steps
\begin {align*} \int \frac {c+d x}{(a+i a \tan (e+f x))^2} \, dx &=\frac {x (c+d x)}{4 a^2}+\frac {i (c+d x)}{4 f (a+i a \tan (e+f x))^2}+\frac {i (c+d x)}{4 f \left (a^2+i a^2 \tan (e+f x)\right )}-d \int \left (\frac {x}{4 a^2}+\frac {i}{4 f (a+i a \tan (e+f x))^2}+\frac {i}{4 f \left (a^2+i a^2 \tan (e+f x)\right )}\right ) \, dx\\ &=-\frac {d x^2}{8 a^2}+\frac {x (c+d x)}{4 a^2}+\frac {i (c+d x)}{4 f (a+i a \tan (e+f x))^2}+\frac {i (c+d x)}{4 f \left (a^2+i a^2 \tan (e+f x)\right )}-\frac {(i d) \int \frac {1}{(a+i a \tan (e+f x))^2} \, dx}{4 f}-\frac {(i d) \int \frac {1}{a^2+i a^2 \tan (e+f x)} \, dx}{4 f}\\ &=-\frac {d x^2}{8 a^2}+\frac {x (c+d x)}{4 a^2}+\frac {d}{16 f^2 (a+i a \tan (e+f x))^2}+\frac {i (c+d x)}{4 f (a+i a \tan (e+f x))^2}+\frac {d}{8 f^2 \left (a^2+i a^2 \tan (e+f x)\right )}+\frac {i (c+d x)}{4 f \left (a^2+i a^2 \tan (e+f x)\right )}-\frac {(i d) \int 1 \, dx}{8 a^2 f}-\frac {(i d) \int \frac {1}{a+i a \tan (e+f x)} \, dx}{8 a f}\\ &=-\frac {i d x}{8 a^2 f}-\frac {d x^2}{8 a^2}+\frac {x (c+d x)}{4 a^2}+\frac {d}{16 f^2 (a+i a \tan (e+f x))^2}+\frac {i (c+d x)}{4 f (a+i a \tan (e+f x))^2}+\frac {3 d}{16 f^2 \left (a^2+i a^2 \tan (e+f x)\right )}+\frac {i (c+d x)}{4 f \left (a^2+i a^2 \tan (e+f x)\right )}-\frac {(i d) \int 1 \, dx}{16 a^2 f}\\ &=-\frac {3 i d x}{16 a^2 f}-\frac {d x^2}{8 a^2}+\frac {x (c+d x)}{4 a^2}+\frac {d}{16 f^2 (a+i a \tan (e+f x))^2}+\frac {i (c+d x)}{4 f (a+i a \tan (e+f x))^2}+\frac {3 d}{16 f^2 \left (a^2+i a^2 \tan (e+f x)\right )}+\frac {i (c+d x)}{4 f \left (a^2+i a^2 \tan (e+f x)\right )}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.54, size = 130, normalized size = 0.86 \begin {gather*} -\frac {\sec ^2(e+f x) \left (8 (d+2 i c f+2 i d f x)+\left (4 c f (i+4 f x)+d \left (1+4 i f x+8 f^2 x^2\right )\right ) \cos (2 (e+f x))+\left (4 c f (1+4 i f x)+d \left (-i+4 f x+8 i f^2 x^2\right )\right ) \sin (2 (e+f x))\right )}{64 a^2 f^2 (-i+\tan (e+f x))^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.57, size = 82, normalized size = 0.54
method | result | size |
risch | \(\frac {d \,x^{2}}{8 a^{2}}+\frac {c x}{4 a^{2}}+\frac {i \left (2 d x f +2 c f -i d \right ) {\mathrm e}^{-2 i \left (f x +e \right )}}{8 f^{2} a^{2}}+\frac {i \left (4 d x f +4 c f -i d \right ) {\mathrm e}^{-4 i \left (f x +e \right )}}{64 f^{2} a^{2}}\) | \(82\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: RuntimeError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.36, size = 82, normalized size = 0.54 \begin {gather*} \frac {{\left (4 i \, d f x + 4 i \, c f + 8 \, {\left (d f^{2} x^{2} + 2 \, c f^{2} x\right )} e^{\left (4 i \, f x + 4 i \, e\right )} - 8 \, {\left (-2 i \, d f x - 2 i \, c f - d\right )} e^{\left (2 i \, f x + 2 i \, e\right )} + d\right )} e^{\left (-4 i \, f x - 4 i \, e\right )}}{64 \, a^{2} f^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.21, size = 226, normalized size = 1.50 \begin {gather*} \begin {cases} \frac {\left (\left (32 i a^{2} c f^{3} e^{2 i e} + 32 i a^{2} d f^{3} x e^{2 i e} + 8 a^{2} d f^{2} e^{2 i e}\right ) e^{- 4 i f x} + \left (128 i a^{2} c f^{3} e^{4 i e} + 128 i a^{2} d f^{3} x e^{4 i e} + 64 a^{2} d f^{2} e^{4 i e}\right ) e^{- 2 i f x}\right ) e^{- 6 i e}}{512 a^{4} f^{4}} & \text {for}\: a^{4} f^{4} e^{6 i e} \neq 0 \\\frac {x^{2} \cdot \left (2 d e^{2 i e} + d\right ) e^{- 4 i e}}{8 a^{2}} + \frac {x \left (2 c e^{2 i e} + c\right ) e^{- 4 i e}}{4 a^{2}} & \text {otherwise} \end {cases} + \frac {c x}{4 a^{2}} + \frac {d x^{2}}{8 a^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.54, size = 107, normalized size = 0.71 \begin {gather*} \frac {{\left (8 \, d f^{2} x^{2} e^{\left (4 i \, f x + 4 i \, e\right )} + 16 \, c f^{2} x e^{\left (4 i \, f x + 4 i \, e\right )} + 16 i \, d f x e^{\left (2 i \, f x + 2 i \, e\right )} + 4 i \, d f x + 16 i \, c f e^{\left (2 i \, f x + 2 i \, e\right )} + 4 i \, c f + 8 \, d e^{\left (2 i \, f x + 2 i \, e\right )} + d\right )} e^{\left (-4 i \, f x - 4 i \, e\right )}}{64 \, a^{2} f^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 2.77, size = 103, normalized size = 0.68 \begin {gather*} \frac {d\,x^2}{8\,a^2}-{\mathrm {e}}^{-e\,4{}\mathrm {i}-f\,x\,4{}\mathrm {i}}\,\left (\frac {\left (-4\,c\,f+d\,1{}\mathrm {i}\right )\,1{}\mathrm {i}}{64\,a^2\,f^2}-\frac {d\,x\,1{}\mathrm {i}}{16\,a^2\,f}\right )-{\mathrm {e}}^{-e\,2{}\mathrm {i}-f\,x\,2{}\mathrm {i}}\,\left (\frac {\left (-2\,c\,f+d\,1{}\mathrm {i}\right )\,1{}\mathrm {i}}{8\,a^2\,f^2}-\frac {d\,x\,1{}\mathrm {i}}{4\,a^2\,f}\right )+\frac {c\,x}{4\,a^2} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________